Option Explicit On 
Option Strict On

'Just uses the old basic collection class.

Imports TreeCreeper01Interfaces

Friend Class cTaxonomicSpeciesCollection
    Implements ITaxonomicSpeciesCollection

    Private pTaxonomicSpeciesCollection As Collection

    Public Sub New()
        pTaxonomicSpeciesCollection = New Collection
    End Sub

    Public Sub AddSpecies(ByVal Species As ITaxonomicSpecies)
        pTaxonomicSpeciesCollection.Add(Species, LCase(Species.UniqueKey))
    End Sub

    Public ReadOnly Property Count() As Integer Implements ITaxonomicSpeciesCollection.Count
        Get
            Return pTaxonomicSpeciesCollection.Count
        End Get
    End Property

    Public ReadOnly Property TaxonomicSpeciesByIndexBaseOne(ByVal Index As Integer) As ITaxonomicSpecies Implements ITaxonomicSpeciesCollection.TaxonomicSpeciesByIndexBaseOne
        Get
            Return CType(pTaxonomicSpeciesCollection.Item(Index), ITaxonomicSpecies)
        End Get
    End Property

    Public ReadOnly Property TaxonomicSpeciesByUniqueKey(ByVal UniqueKey As String) As ITaxonomicSpecies Implements ITaxonomicSpeciesCollection.TaxonomicSpeciesByUniqueKey
        Get
            Return (CType(pTaxonomicSpeciesCollection.Item(LCase(UniqueKey)), ITaxonomicSpecies))
        End Get
    End Property

End Class
